<?php include '../nav.php';
	$pid = ($_SESSION['home']['id']);
	// var_dump($pid);exit;

	// $prid= ($_GET($pid));
	// var_dump($prid);exit; 
	// var_dump($_SESSION['home']);exit;
	$sql = 'select `icon`, `tel`, `nickname`, `sex` ,`email`, `id`
			from user
			where id='.$pid.'';
	// echo ($sql);exit; 

	$per_list = query($sql)[0];
	// var_dump($per_list);exit; 
	// var_dump(query($sql)[0]);exit;
 ?>
<link rel="stylesheet" href="<?= CSS?>space.css">

	<div id='main'>
		<div class='member_left'>
			<h3>
				<a href="<?= URL?>404.php">个人中心</a>
			</h3>
		<div class='order'>
				<h4>我的订单</h4>
				<ul>
					<li><a href="receive.php">待收货</a></li>
					<li><a href="pay.php">待付款</a></li>
					<li><a href="orders.php">全部订单</a></li>
				</ul>
			</div>
			<div class='order'>	
				<h4>账号信息</h4>
				<ul>
					<li><a href="personal.php">个人资料</a></li>
					<li class='receiving'><a href="edit.php">修改密码</a></li>
				</ul>
			</div>
		</div>
		<div class='member_right'>
			<h4>修改资料</h4>
			<form action="action.php?bz=edit" method='post' enctype='multipart/form-data'>
			
				<div class='personal'>
					<dl>
						<dt>头像 : </dt>
						<dd><input type="file" name='icon'></dd>
					</dl>
					<dl>
						<dt>手机号 : </dt>
						<dd> <?= $per_list['tel']?> </dd>
					</dl>
					<dl>
						<dt>昵称 : </dt>
						<dd><input type="text" name='nickname' value='<?= $per_list['nickname']?>'></dd>
					</dl>
					<dl>
						<dt>性别 : </dt>
						<dd>
							<label><input type="radio" name='sex' value=1 <?= $per_list['sex'] ==1?'checked':'' ?>> 男</label>
							<label><input type="radio" name='sex' value=2 <?= $user_list['sex'] ==2?'checked':'' ?>> 女</label>
						</dd>
					</dl>
					<dl>
						<dt>邮箱 : </dt>
						<dd><input type="email" name='email' value='<?= $per_list['email']?>'></dd>
					</dl>
					<dl>
						<dt></dt>
						<dd><input type='submit' class='update_btn' value='保存'></dd>
					</dl>
				</div>
			</form>
		</div>
	</div>
<?php include '../foot.php' ?>

	